package models;

public class Board
{
    private int [][] matrix;
    private static Board thisBoard = null;

    private Board()
    {
        matrix = new int [9][9];
    }

    public void setNumber(int i, int j, int number)
    {
        matrix[i][j] = number;
    }

    public int getNumber(int i, int j)
    {
        return matrix[i][j];
    }

    public void reset()
    {
        for (int i = 0; i < 9; i++)
            for (int j = 0; j < 9; j++)
                this.matrix[i][j] = 0;
    }

    public int[][] getMatrix()
    {
        return matrix;
    }

    public void setMatrix(int[][] matrix)
    {
        for (int i = 0; i < 9; i++)
            for (int j = 0; j < 9; j++)
                this.matrix[i][j] = matrix[i][j] ;
    }

    public static synchronized Board getInstance()
    {
        if (thisBoard == null)
            thisBoard = new Board();

        return thisBoard;
    }
}
